﻿#define _CRT_SECURE_NO_WARNINGS  1
//一定要动手，例子不管多么简单，建议至少自己手敲一遍看看是否理解了里头的细枝末节。
//一定要学会思考，思考为什么要这样，而不是那样。还要举一反三地思考
#include<string>
#include<iostream>
using namespace std;
class Phone {
public:
	string p_name;
public:
	Phone(string name)
	{
		cout << "Phone  构造函数调用" << endl;
		p_name = name;
	}
	~Phone()
	{
		cout << "Phone 析构函数调用" << endl;
	}

};
class person {
public:
	string _name;
	Phone i_name;
public:
	person(string name, string p_name):_name(name),i_name(p_name)
	{
		cout << "person 参数构造函数调用" << endl;
	}
	~person()
	{
		cout << " person 析构函数调用" << endl;
	}

};
void test1()
{
	person p1("张三","苹果ProMax");
	cout << p1._name << "拿着" << p1.i_name.p_name << endl;
}
int main()
{
	test1();
	system("pause");
	return 0;
}
